6 typedef unsigned int uint
;
7 typedef unsigned short ushort
;
9 #define Max_memo 1000001
10 vector
<ushort
> d(Max_memo
, 0);
12 #define memorizado(x) ((x) < Max_memo && d[(x)] != 0)
13 #define next(n) ((n) % 2 == 0 ? (n) / 2 : 3 * (n) + 1)
15 ushort
periodo(uint n
) {
19 ushort p
= periodo(next(n
)) + 1;
27 ushort
resolver(uint x
, uint y
){
44 int main(int argc
, char **argv
)
48 while (scanf("%u %u",&x
,&y
)==2) {
49 cout
<< x
<<" "<< y
<<" " << resolver(x
, y
) << endl
;